﻿
namespace UserDefinedForms.Windows.Forms
{
	/// <summary>
	/// abstract DesignForm typed datagridview
	/// </summary>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class DesignFormDataGridViewBase : System.Windows.Forms.UserControl
	{	
		/// <summary> 
		/// Thrown when the current Entity changed.
		/// </summary>
		public event System.EventHandler<DesignFormDataGridViewEventArgs> CurrentEntityChanged;
		
		#region Fields
				
		/// <summary> 
		/// the current entity.
		/// </summary>
		private Entities.DesignForm _currentDesignForm = null;
		//private Dictionary<string, string> _columnsHeaders = new Dictionary<string, string>();
		
		/// <summary> 
		/// the datagridview instance
		/// </summary>
		protected System.Windows.Forms.DataGridView uxDesignFormDataGridView;
		
		/// <summary> 
		/// the errorprovider
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxDesignFormErrorProvider;
		
		/// <summary> 
		/// the bindingsource
		/// </summary>
		protected System.Windows.Forms.BindingSource uxDesignFormBindingSource;
		
		
		/// <summary> 
		/// the DGV column associated with the FormId property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxFormIdDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Name property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxNameDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Status property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxStatusDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the Description property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDescriptionDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the EffectiveDate property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxEffectiveDateDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the CreatedDate property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxCreatedDateDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the ModifiedDate property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxModifiedDateDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the UserId property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxUserIdDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the FormType property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxFormTypeDataGridViewColumn;
		
		#endregion
					
		#region Combo list
		
				
		private Entities.TList<Entities.User> _UserIdList;
		
		/// <summary> 
		/// The list of selectable User
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.User> UserIdList
		{
			get {return this._UserIdList;}
			set 
			{
				this._UserIdList = value;
				this.uxUserIdDataGridViewColumn.DataSource = null;
				this.uxUserIdDataGridViewColumn.DataSource = this._UserIdList;
			}
		}
		
		private bool _allowNewItemInUserIdList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of User
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInUserIdList
		{
			get { return _allowNewItemInUserIdList;}
			set
			{
				this._allowNewItemInUserIdList = value;
				this.uxUserIdDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
		#endregion
		
		#region Main Datasource
		
		private Entities.TList<Entities.DesignForm> _DesignFormList;
				
		/// <summary> 
		/// The list of DesignForm to be displayed in the DGV.
		/// </summary>
		[System.ComponentModel.Category("Data")]
		public Entities.TList<Entities.DesignForm> DesignFormList
		{
			get {return this._DesignFormList;}
			set
			{
				this._DesignFormList = value;
				this.uxDesignFormBindingSource.DataSource = null;
				this.uxDesignFormBindingSource.DataSource = value;
				this.uxDesignFormDataGridView.DataSource = null;
				this.uxDesignFormDataGridView.DataSource = this.uxDesignFormBindingSource;				
				//this.uxDesignFormBindingSource.ListChanged += new System.ComponentModel.ListChangedEventHandler(uxDesignFormBindingSource_ListChanged);
				this.uxDesignFormBindingSource.CurrentItemChanged += new System.EventHandler(OnDesignFormBindingSourceCurrentItemChanged);
			}
		}
		
		private void OnDesignFormBindingSourceCurrentItemChanged(object sender, System.EventArgs e)
		{
			_currentDesignForm = uxDesignFormBindingSource.Current as Entities.DesignForm;
			
			if (_currentDesignForm != null)
			{
				_currentDesignForm.Validate();
			}
			//_DesignForm.Validate();
			OnCurrentEntityChanged();
		}

		//void uxDesignFormBindingSource_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
		//{
			//throw new Exception("The method or operation is not implemented.");
		//}		
		
		#endregion
		
		/// <summary>
		/// Gets the currently selected <see cref="Entities.DesignForm"/> instance.
		/// </summary>
		public Entities.DesignForm SelectedDesignForm
		{
			get {return this._currentDesignForm;}
		}
		
		#region other properties
		
		/// <summary>
		/// Gets or sets a value indicating whether you have provided your own data-management operations for the DataGridView control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool VirtualMode
		{
			get {return this.uxDesignFormDataGridView.VirtualMode;}
			set
			{
				this.uxDesignFormDataGridView.VirtualMode = value;
			}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the option to add rows is displayed to the user.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToAddRows
		{
			get {return this.uxDesignFormDataGridView.AllowUserToAddRows;}
			set {this.uxDesignFormDataGridView.AllowUserToAddRows = value;}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToDeleteRows
		{
			get {return this.uxDesignFormDataGridView.AllowUserToDeleteRows;}
			set {this.uxDesignFormDataGridView.AllowUserToDeleteRows = value;}
		}
		
		/// <summary>
		/// Gets the <see cref="DataGridView"/> instance.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public System.Windows.Forms.DataGridView DataGridView
		{
			get {return this.uxDesignFormDataGridView;}
		}
		
		/// <summary>
		/// Gets a collection that contains all the columns in the control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]		
		[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
		//[System.ComponentModel.EditorAttribute("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] 
		public System.Windows.Forms.DataGridViewColumnCollection Columns
		{
			get { return this.uxDesignFormDataGridView.Columns; }
		}
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;
	
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	
		#region Constructor
	
		/// <summary>
		/// Initializes a new instance of the <see cref="DesignFormDataGridViewBase"/> class.
		/// </summary>
		public DesignFormDataGridViewBase()
		{			
			this.components = new System.ComponentModel.Container();			
			
			this.uxDesignFormDataGridView = new System.Windows.Forms.DataGridView();
			this.uxDesignFormBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.uxDesignFormErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxFormIdDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxNameDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxStatusDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDescriptionDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxEffectiveDateDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxCreatedDateDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxModifiedDateDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxUserIdDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxFormTypeDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			//this.uxUserIdBindingSource = new UserBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxUserIdBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxDesignFormDataGridView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxDesignFormBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxDesignFormErrorProvider)).BeginInit();
			this.SuspendLayout();
						
			// 
			// uxDesignFormErrorProvider
			// 
			this.uxDesignFormErrorProvider.ContainerControl = this;
			this.uxDesignFormErrorProvider.DataSource = this.uxDesignFormBindingSource;						
			// 
			// uxDesignFormDataGridView
			// 
			this.uxDesignFormDataGridView.AutoGenerateColumns = false;
			this.uxDesignFormDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.uxDesignFormDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
		this.uxFormIdDataGridViewColumn,
		this.uxNameDataGridViewColumn,
		this.uxStatusDataGridViewColumn,
		this.uxDescriptionDataGridViewColumn,
		this.uxEffectiveDateDataGridViewColumn,
		this.uxCreatedDateDataGridViewColumn,
		this.uxModifiedDateDataGridViewColumn,
		this.uxUserIdDataGridViewColumn,
		this.uxFormTypeDataGridViewColumn			});
			this.uxDesignFormDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
			this.uxDesignFormDataGridView.Location = new System.Drawing.Point(0, 0);
			this.uxDesignFormDataGridView.Name = "uxDesignFormDataGridView";
			this.uxDesignFormDataGridView.Size = new System.Drawing.Size(470, 300);
			this.uxDesignFormDataGridView.TabIndex = 0;	
			this.uxDesignFormDataGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke;
			this.uxDesignFormDataGridView.EnableHeadersVisualStyles = false;
			this.uxDesignFormDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.OnDesignFormDataGridViewDataError);
			this.uxDesignFormDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnDesignFormDataGridViewCellValueNeeded);
			this.uxDesignFormDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnDesignFormDataGridViewCellValuePushed);
			
			//
			// uxFormIdDataGridViewColumn
			//
			this.uxFormIdDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxFormIdDataGridViewColumn.DataPropertyName = "FormId";
			this.uxFormIdDataGridViewColumn.HeaderText = "FormId";
			this.uxFormIdDataGridViewColumn.Name = "uxFormIdDataGridViewColumn";
			this.uxFormIdDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxFormIdDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxFormIdDataGridViewColumn.ReadOnly = true;		
			//
			// uxNameDataGridViewColumn
			//
			this.uxNameDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxNameDataGridViewColumn.DataPropertyName = "Name";
			this.uxNameDataGridViewColumn.HeaderText = "Name";
			this.uxNameDataGridViewColumn.Name = "uxNameDataGridViewColumn";
			this.uxNameDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxNameDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxNameDataGridViewColumn.ReadOnly = false;		
			//
			// uxStatusDataGridViewColumn
			//
			this.uxStatusDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxStatusDataGridViewColumn.DataPropertyName = "Status";
			this.uxStatusDataGridViewColumn.HeaderText = "Status";
			this.uxStatusDataGridViewColumn.Name = "uxStatusDataGridViewColumn";
			this.uxStatusDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxStatusDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxStatusDataGridViewColumn.ReadOnly = false;		
			//
			// uxDescriptionDataGridViewColumn
			//
			this.uxDescriptionDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDescriptionDataGridViewColumn.DataPropertyName = "Description";
			this.uxDescriptionDataGridViewColumn.HeaderText = "Description";
			this.uxDescriptionDataGridViewColumn.Name = "uxDescriptionDataGridViewColumn";
			this.uxDescriptionDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDescriptionDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDescriptionDataGridViewColumn.ReadOnly = false;		
			//
			// uxEffectiveDateDataGridViewColumn
			//
			this.uxEffectiveDateDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxEffectiveDateDataGridViewColumn.DataPropertyName = "EffectiveDate";
			this.uxEffectiveDateDataGridViewColumn.HeaderText = "EffectiveDate";
			this.uxEffectiveDateDataGridViewColumn.Name = "uxEffectiveDateDataGridViewColumn";
			this.uxEffectiveDateDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxEffectiveDateDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxEffectiveDateDataGridViewColumn.ReadOnly = false;		
			//
			// uxCreatedDateDataGridViewColumn
			//
			this.uxCreatedDateDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxCreatedDateDataGridViewColumn.DataPropertyName = "CreatedDate";
			this.uxCreatedDateDataGridViewColumn.HeaderText = "CreatedDate";
			this.uxCreatedDateDataGridViewColumn.Name = "uxCreatedDateDataGridViewColumn";
			this.uxCreatedDateDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxCreatedDateDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxCreatedDateDataGridViewColumn.ReadOnly = false;		
			//
			// uxModifiedDateDataGridViewColumn
			//
			this.uxModifiedDateDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxModifiedDateDataGridViewColumn.DataPropertyName = "ModifiedDate";
			this.uxModifiedDateDataGridViewColumn.HeaderText = "ModifiedDate";
			this.uxModifiedDateDataGridViewColumn.Name = "uxModifiedDateDataGridViewColumn";
			this.uxModifiedDateDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxModifiedDateDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxModifiedDateDataGridViewColumn.ReadOnly = false;		
			//
			// uxUserIdDataGridViewColumn
			//
			this.uxUserIdDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxUserIdDataGridViewColumn.DataPropertyName = "UserId";
			this.uxUserIdDataGridViewColumn.HeaderText = "UserId";
			this.uxUserIdDataGridViewColumn.Name = "uxUserIdDataGridViewColumn";
			this.uxUserIdDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxUserIdDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxUserIdDataGridViewColumn.ReadOnly = false;		
			//
			// uxFormTypeDataGridViewColumn
			//
			this.uxFormTypeDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxFormTypeDataGridViewColumn.DataPropertyName = "FormType";
			this.uxFormTypeDataGridViewColumn.HeaderText = "FormType";
			this.uxFormTypeDataGridViewColumn.Name = "uxFormTypeDataGridViewColumn";
			this.uxFormTypeDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxFormTypeDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxFormTypeDataGridViewColumn.ReadOnly = false;		
			//
			// uxUserIdDataGridViewColumn
			//				
			this.uxUserIdDataGridViewColumn.DisplayMember = "UserName";	
			this.uxUserIdDataGridViewColumn.ValueMember = "UserId";	
			this.uxUserIdDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxUserIdDataGridViewColumn.DataSource = uxUserIdBindingSource;				
				
			
			// this
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.uxDesignFormDataGridView);
			this.Name = "DesignFormDataGridView";
			this.Size = new System.Drawing.Size(470, 300);
			//((System.ComponentModel.ISupportInitialize)(this.uxUserIdBindingSource)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxDesignFormErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxDesignFormDataGridView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxDesignFormBindingSource)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion
				
		#region events
		
		/// <summary>
		/// Raised the CurrentEntityChanged event.
		/// </summary>
		protected void OnCurrentEntityChanged()
		{
			if (CurrentEntityChanged != null)
			{
				DesignFormDataGridViewEventArgs args = new DesignFormDataGridViewEventArgs();
				args.DesignForm = _currentDesignForm;
				CurrentEntityChanged(this, args); 
			}
		}
		
		#endregion
		
		/// <summary>
		/// Strongly typed event 
		/// </summary>
		public class DesignFormDataGridViewEventArgs : System.EventArgs
		{
			private Entities.DesignForm	_DesignForm;
	
			/// <summary>
			/// the  Entities.DesignForm instance.
			/// </summary>
			public Entities.DesignForm DesignForm
			{
				get { return _DesignForm; }
				set { _DesignForm = value; }
			}	
		}
		
		/// <summary>
		/// Handles the DataError event of the uxDesignFormDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs"/> instance containing the event data.</param>
		protected void OnDesignFormDataGridViewDataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(string.Format( "{0}, {1}", e.ColumnIndex, e.RowIndex));
		}
		
		/// <summary>
		/// Handles the CellValueNeeded event of the uxDesignFormDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnDesignFormDataGridViewCellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxDesignFormDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxFormIdDataGridViewColumn":
						e.Value = DesignFormList[e.RowIndex].FormId;
						break;
					case "uxNameDataGridViewColumn":
						e.Value = DesignFormList[e.RowIndex].Name;
						break;
					case "uxStatusDataGridViewColumn":
						e.Value = DesignFormList[e.RowIndex].Status;
						break;
					case "uxDescriptionDataGridViewColumn":
						e.Value = DesignFormList[e.RowIndex].Description;
						break;
					case "uxEffectiveDateDataGridViewColumn":
						e.Value = DesignFormList[e.RowIndex].EffectiveDate;
						break;
					case "uxCreatedDateDataGridViewColumn":
						e.Value = DesignFormList[e.RowIndex].CreatedDate;
						break;
					case "uxModifiedDateDataGridViewColumn":
						e.Value = DesignFormList[e.RowIndex].ModifiedDate;
						break;
					case "uxUserIdDataGridViewColumn":
						e.Value = DesignFormList[e.RowIndex].UserId;
						break;
					case "uxFormTypeDataGridViewColumn":
						e.Value = DesignFormList[e.RowIndex].FormType;
						break;
				default:
				break;
			}
		}
		
		/// <summary>
		/// Handles the CellValuePushed event of the uxDesignFormDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnDesignFormDataGridViewCellValuePushed(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxDesignFormDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxFormIdDataGridViewColumn":
						DesignFormList[e.RowIndex].FormId = (System.Int32)e.Value;
						break;
					case "uxNameDataGridViewColumn":
						DesignFormList[e.RowIndex].Name = (System.String)e.Value;
						break;
					case "uxStatusDataGridViewColumn":
						DesignFormList[e.RowIndex].Status = (System.Int32)e.Value;
						break;
					case "uxDescriptionDataGridViewColumn":
						DesignFormList[e.RowIndex].Description = (System.String)e.Value;
						break;
					case "uxEffectiveDateDataGridViewColumn":
						DesignFormList[e.RowIndex].EffectiveDate = (System.DateTime?)e.Value;
						break;
					case "uxCreatedDateDataGridViewColumn":
						DesignFormList[e.RowIndex].CreatedDate = (System.DateTime?)e.Value;
						break;
					case "uxModifiedDateDataGridViewColumn":
						DesignFormList[e.RowIndex].ModifiedDate = (System.DateTime?)e.Value;
						break;
					case "uxUserIdDataGridViewColumn":
						DesignFormList[e.RowIndex].UserId = (System.Int32)e.Value;
						break;
					case "uxFormTypeDataGridViewColumn":
						DesignFormList[e.RowIndex].FormType = (System.Int32)e.Value;
						break;
				default:
				break;
			}
		}
	}
}
